package com.xpjhs.role.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.xpjhs.*;
import com.xpjhs.permission.model.Permission;
@Entity(name = "com.xpjhs.role.model.Role")
@Table(name = "xpjhs_role")
public class Role implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5665720174677401867L;

	private long id;
	private String rolename; // 角色名称
	private String roleDesc;// 角色描述
	private Integer orderIndex; // 排序
	private Integer activeFlag; // 是否可用
	private String homePage; // 角色主页

	private List<Permission> permissions; // 角色权限

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getRolename() {
		return rolename;
	}

	public void setRolename(String rolename) {
		this.rolename = rolename;
	}

	public String getRoleDesc() {
		return roleDesc;
	}

	public void setRoleDesc(String roleDesc) {
		this.roleDesc = roleDesc;
	}

	public Integer getOrderIndex() {
		return orderIndex;
	}

	public void setOrderIndex(Integer orderIndex) {
		this.orderIndex = orderIndex;
	}

	public Integer getActiveFlag() {
		return activeFlag;
	}

	public void setActiveFlag(Integer activeFlag) {
		this.activeFlag = activeFlag;
	}

	public String getHomePage() {
		return homePage;
	}

	public void setHomePage(String homePage) {
		this.homePage = homePage;
	}

	@OneToMany(mappedBy = "roles")
	public List<Permission> getPermissions() {
		return permissions;
	}

	public void setPermissions(List<Permission> permissions) {
		this.permissions = permissions;
	}

}
